import { defineStore, acceptHMRUpdate } from "pinia";

export const runtimeAppStore = defineStore({
  id: "runtime",
  state: () => ({
    mainWinID: 0,
    loaclWebResPath: '',
  } as any),
  actions: {
    setLoaclWebResPath(path: string) {
      this.loaclWebResPath = import.meta.env.MODE === 'development' ? location.origin : path + 'index.html'
    },
    setMainWinID(id: number) {
      this.mainWinID = id
    }
  }
});
if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(runtimeAppStore, import.meta.hot));
}
